home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Sound Cards
/
Programming Sound Cards.iso
/
sound_79
/
soundhax.doc
< prev
next >
Wrap
Text File
|
1995-01-01
|
10KB
|
246 lines
SOUNDHAX v1 by John M. Trindle
Synopsis: Utilities and source code for use with Sound Blaster,
Sound Blaster Pro, and ProAudio Spectrum. REC_CD
may be of interest to anyone with an audio-capable
CD-ROM drive.
PLAYD: .VOC file player, direct to disk.
RECD: .VOC file recorder, direct to disk.
REC_CD: Play and record to .VOC sections of CD audio.
TALK: Hear and see the phonetic version of text
run through SBTALK
EXCEPT: Manage an exception dictionary for SBTALK
pronounciation.
Disclaimer:
These programs are hacks, without reference to the proper
documentation. None are guaranteed to run at all on
your particular system. The worst case example is REC_CD,
which has only been tested under a beta copy of SB2MV, the
Sound Blaster *EMULATOR* for the ProAudio Spectrum. I have
spent almost zero time on the user interface... you see
the small bits of knowledge as I gleaned them.
Self-Pitying Indulgence:
These hacks reflect my tortuous journey through the realm
of sound card programming (so far). It has been very
difficult to get customer and technical support for either
the Sound Blaster, SB-PRO, or the ProAudio Spectrum cards.
As an amateur musician and simulator programmer, I find
the potential of these cards fascinating. But the software
is in its infancy. Perhaps the source code included will
form a basis for *REAL* software.
So what's it all about, Alfie?
OK, here goes.
>>DIGITAL SOUND<<
PLAYD.EXE: PLAYD <filename.voc>
This program will play a Sound Blaster .VOC file from
disk, at the recorded sampling rate. It illustrates
the setup and detection. If you do not use the
DriverFeatures variable on a machine without an SB
compatible environment, you WILL lock it up.
There are a bazillion .VOC players out there, but no
source code that use the standard Creative Music library
that I can find.
>> LATTICE C <<
PLAYD MKMYDAY.VOC
RECD.EXE: RECD <filename.voc>
This is the recording side of the CTVD system. Note
the similarities to the play side, and the relative
simplicity of the whole shebang. It only records
at the default sampling rate.
>> LATTICE C <<
RECD METALKING.VOC
REC_CD.EXE: REC_CD [TRACK] [START] [END] [FILENAME]
Ah, the crux of the biscuit indeed. This is an
incredibly messy but somewhat interesting combination
of MSCDEX and Sound Blaster code. This program has
several functions:
1) No parameters. Lists the track numbers and
approximate durations of each.
2) With Track number. Plays audio CD from the
beginning of that track to the end of the disk.
3) With Track and Start. Plays audio CD from the
MM:SS.S offset in the Track to the end.
4) Track, Start, End. Plays audio CD from Track
with offset Start to offset End (MM:SS.S). Note that
this can overlap into the next track.
5) Track, Start, End, Filename. This plays the segment
selected above, AND RECORDS a monophonic .VOC file
at the default sampling rate. You must hit a key
to terminate recording, even though the CD has stopped
playing. This is very nice on the MPC boards such as
the SB-PRO and the ProAudio Spectrum.
Offsets are in Minutes and Decimal Seconds, to the
nearest 1/75th of a second (a CD *frame*).
The intent of this program is to facilitate transfer of
sounds from Sound Effects Disks, and instrument slices
for fine programs such as TRAKBLASTER. I also wanted to
read the 16 bit data directly, to use as source material
for off-line signal processing experiments. Alas, that
ability appears to be locked out of most CD-ROM players.
It is NOT my intent that you use this to infringe on
copyrights. Any clips which diminish the commercial value
of the source material are expressly prohibited by law.
Besides, the quality of eight-bit sampling is sufficiently
low, and the disk consumption prohibitive for piracy purposes.
But remember, neither I nor Larry "Bud" Melman are lawyers.
>> LATTICE C <<
>>TEXT-TO-SPEECH<<
EXCEPT.EXE:
This program shows how the sbts_dict_add and sbts_dict_del
commands work. It is part of my project to improve the
pronounciation of SBTALK. A sample dictionary generated
from a word list with TALK.EXE is included. This is
a very rudimentary utility to manage a source and an
exception dictionary. A companion utility would be one
that would read the exception dictionary into SBTALK. You
can do this just by using sbts_dict_add as shown here but
not deleting the word before program exit. The dictionary
for SBTALK is best stored in EMS memory.
>> TURBO C<
TALK.EXE
This program will take a line from Standard Input,
say it, and print the line and the SBTALK phonetic equivalent
to Standard Output. Thus it can be used as a filter. It
shows the use of the GENDER, TONE, VOLUME, PITCH and SPEED
parameters. GENDER has no effect in the SBTALK which I used.
>> TURBO C <<
Development Environment:
Hardware: 486-33, Seagate IDE drives, Chinon 431 CD-ROM, Lantastic
network, Sound Blaster (initially) and ProAudio Spectrum
(subsequently).
Software: Lattice C 6.05, SBCL.LIB, source for CDPLAYER and
CD.GL (an amazingly powerfule GRASP script). QEMM 5.11
and Windows 3.0.
Notes:
Our default mode for Lattice C does *not* add underscores to the
front of variable and function names. In order to link Microsoft C
or Turbo C programs with SBCL.LIB, you will need to remove those
leading underscores from these examples.
SBCL.LIB is available on most sound-oriented BBSs, including Creative
Music Labs' own support board. You will also want to pick up a copy
of the SBQC.LIB (the Quick Basic library) since it has include files,
whereas the C version does not. If you want docs, you have to call
Brown-Wagh publishing, wade through a few days of phone tag to get
a *salesman*, and then pay $70 to $100 depending on their mood and the
day of the week. I am still waiting for them to SHIP the development
kit I ordered 6 weeks ago. However, there are many functions in
the SBCL that I have not puzzled out, and I wouldn't ship commercial
software based on my hacks. So here I wait, twiddling my bits.
Some documentation for MSCDEX is available on Compuserve in the
Microsoft Library. Of course, MS will also sell you a proper
development package.
The file CDPLAYER.ARC contains much cleaner source than mine, and
has additional functions for doing data reads, etc. The header file
is complete with all the needed #defines and typedefs. HOWEVER,
there is a crucial module missing: SEND.ASM, which is the actual
interface to the 2FH multiplex interrupt.
CDSRC.ARC doesn't look like much when you V)iew it on a BBS. But
that .GL script file contained the info I needed to reconstruct
the missing SEND.ASM functionality. It is not exactly a text file,
so your editor may have troubles with it. Unfortunately, the program
itself is somewhat buggy. I was very impressed by the power of the
Grasp language, even though it looks a little too much like BASIC
for my tastes. REC_CD's CD code is largely based on this script
as well as CDPLAYER.
SB2MV is a Sound Blaster Emulator for the ProAudio Spectrum. It works
remarkably well for what it does (meaning it crashes a lot). I am still
using the .87 beta, I believe. The DIGITAL software runs fine under
SB2MV, though it seems slightly more stable in the Windows 3.0 version
of the driver. SBTALK will not run for long under this emulator.
Recording or playings samples on floppies leads to trouble.
SBTALK will crash occasionally no matter what you do, but it likes
EMS better (plus you don't get a 170K+ hit on conventional memory).
====================================================================
IF YOU LIKE THIS CODE (or the idea behind it) DO ME A FAVOR, OK?
1) Keep my name as the original author. You know, "based on"
"influenced by" "a strong hateful reaction to" SoundHax v1
by John M. Trindle.
2) Write something good, and preferably free! The world is in
desparate need of a freeware/PD *LARGE* sample editor, with
effects/DSP enhancement algorithms. A low cost speech recognition
engine for the Sound Blaster or ProAudio input. A hardware kit
to use stereo 8 bit as mono 16 bit. A good tutorial on programming
the two-op Adlib-compatible sound. A methodology for integrating
sound cues in the user interface in a useful manner. Another
*large* (I mean *LARGE*, like 2 meg files) sample editor. Where
you can draw waveforms and use them for sequencer voices. And
so forth and so on.
BBSs:
Creative Labs: 1-405-624-2601
Media Vision: 1-415-770-0968
You can get me: Compuserve 70303,3506 (Flight Deck Software)
Flight Deck BBS 804-229-1571 (comment to SYSOP)
The Blues Exchange 804-220-0533 (E-Music Conference)
I am also on Creative Labs' board frequently, and Media Vision's.
For some reason I am locked out of MV's message bases at the moment,
though.
....John M. Trindle Williamsburg, VA December 19, 1991